package com.hmall.api.client;


import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient("user-service")
public interface UserClient {
    @PutMapping("/users/money/deduct")
    void deductMoney(@RequestParam("pw") String pw,@RequestParam("amount") Integer amount);


    //- @FeignClient("item-service") ：声明服务名称
    //- @GetMapping ：声明请求方式
    //- @GetMapping("/items") ：声明请求路径
    //- @RequestParam("ids") Collection<Long> ids ：声明请求参数
    //- List<ItemDTO> ：返回值类型
    @PostMapping("/users/login")
    void login(@RequestParam("usernmae") String username, @RequestParam(value="rememberMe",required = false,defaultValue = "true") boolean rememberMe, @RequestParam("password") String password);
}
